package com.ddxz.photovoltaic.controller;

import com.ddxz.photovoltaic.service.SyncDataService;
import com.ddxz.tool.web.dto.DdxzResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * class description
 *
 * @author 朱宗刚
 * @version 1.0.0
 * @date 2022/8/20
 */

@Api("数据同步")
@RestController
public class OutputDataController {
    @RequestMapping(value = "/sync", method = RequestMethod.GET)
    @ApiOperation("手动同步")
    public DdxzResponse manualSync() {
        service.syncData();
        return DdxzResponse.correct("OK");
    }

    public OutputDataController(SyncDataService service) {
        this.service = service;
    }

    private final SyncDataService service;
}
